Prevent crashes and related issues if initial activity is destroyed on Android
authorPo Lu <luangruo@yahoo.com>
Thu, 27 Jun 2024 03:06:59 +0000 (11:06 +0800)
committerPo Lu <luangruo@yahoo.com>
Thu, 27 Jun 2024 03:07:38 +0000 (11:07 +0800)
commit860840621a1ebe2e4f17ba8ae78d441ea75650b2
treece491e28fbd0ec6867b9669f77e92c151e8f28c7
parentd5c6eb1f9646781cf103124fb7e88d1fa1cf2473
Prevent crashes and related issues if initial activity is destroyed on Android

* java/org/gnu/emacs/EmacsWindow.java
(EmacsWindow) <initialWindowCreated>: New variable.
(EmacsWindow): If the initial frame has not yet been created,
set attachmentToken to -1.

* java/org/gnu/emacs/EmacsWindowManager.java (registerWindow):
When the window's attachment token is -1 (i.e., it is the
default window), start EmacsActivity rather than
EmacsMultitaskActivity.  Catch exceptions around startActivity.
java/org/gnu/emacs/EmacsWindow.java
java/org/gnu/emacs/EmacsWindowManager.java